package com.hc.websocket.netty.service.impl;

import com.hc.websocket.netty.service.WebSocketService;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.time.Duration;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @Author: huangcheng
 * @CreateTime: 2024-11-20  16:50
 * @Description:
 * @Version: 1.0
 */
@Component
@Slf4j
public class WebSocketServiceImpl implements WebSocketService {
    private static final Duration EXPIRE_TIME = Duration.ofHours(1);
    private static final Long MAX_MUM_SIZE = 10000L;

    /**
     * 所有在线的用户和对应的socket
     */
    private static final ConcurrentHashMap<Long, CopyOnWriteArrayList<Channel>> ONLINE_UID_MAP = new ConcurrentHashMap<>();



    @Override
    public void connect(Channel channel) {

    }

    @Override
    public void removed(Channel channel) {

    }
}
